import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'

//挂载Vuex
Vue.use(Vuex)

//创建Vuex对象
export default new Vuex.Store({
    //存放的键值对就是所要管理的状态
    state,
    // actions: {
    //     changeCity (ctx, city) {
    //         console.log(city)
    //         ctx.commit('changeCity', city)
    //     }
    // },
    mutations,
    // getters: {
    //     doubleCity (state){
    //         return state.city + ' ' + state.city
    //     }
    // }
})